<?php
$user_IP = ($_SERVER["HTTP_VIA"]) ? $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"];
$user_IP = ($user_IP) ? $user_IP : $_SERVER["REMOTE_ADDR"];
echo "你的IP：" .$user_IP ."<br>";
if ( $user_IP == "127.0.0.1" or $user_IP == "59.83.34.4" )
{
$NUMBER = $_REQUEST["number"];
$MSG = $_REQUEST["msg"];
$msgfile = fopen("msg.txt", "w") or die("Unable to open file!");
fwrite($msgfile, $NUMBER);
fwrite($msgfile, "\n");
fwrite($msgfile, $MSG);
fclose($msgfile);
echo "提交短信：\"$MSG\" 到 $NUMBER 成功！";
}
else
{
	echo "没有权限访问";
}
?>
